
	
	var chart;
	function loadChart(obj, data){
		
		var opt = {};
		
		//-------propiedad chart------------
		if ( $(obj).get(0) == null ) return false;
			
		opt.chart = {};
		opt.chart.renderTo= $(obj).get(0);
		
		_type=$(obj).attr("data-type");
		if(_type!=null)
			opt.chart.type = _type;
		
		opt.chart.marginRight=130;
		opt.chart.marginBottom=25;
		//------------propiedad title------
		opt.title={};
		_textTitle=$(obj).attr("data-title");
		if(_textTitle!=null)
			opt.title.text=_textTitle;
		opt.title.x=-20;
		//------------propiedad subtitle-------
		opt.subtitle={};
		_textSubtitle=$(obj).attr("data-subtitle");
		if(_textSubtitle!=null)
			opt.subtitle.text=_textSubtitle;
		opt.subtitle.x=-20;
		//-----propiedad xAxis---------
		opt.xAxis={};
		_categories=$(obj).attr("data-categories").split('|');
		if(_categories!=null)
			opt.xAxis.categories=_categories;
		//------propiedad yAxis-------
		opt.yAxis={};
		opt.yAxis.title={};
		opt.yAxis.plotLines=[{
	                    value: 0,
	                    width: 1,
	                    color: '#808080'
	                }];
		_textTitle= $(obj).attr("data-titleY");	
		if(_textTitle!=null)
		{
			opt.yAxis.title.text=_textTitle;		
		}
			
		//----------propiedad tooltip-------
		var _formatter = $(obj).attr("data-formatter");
		if ( typeof(eval(_formatter)) == 'function' ) {
			
			opt.tooltip = {};
			opt.tooltip.formatter = function () {
				return eval(_formatter+"(this)");
			}
		}
		//-----------propiedad legend-------
		opt.legend={};
		opt.legend.layout='vertical';
		opt.legend.align='right';
		opt.legend.verticalAlign='top';
		opt.legend.x=-10;
		opt.legend.y=100;
		opt.legend.borderWidth=0;
		
		//-------propiedad series----
		opt.series=data;
		//-----
		
		chart= new Highcharts.Chart(opt);
		
	}
